package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.AppModuleEntity;

import java.util.List;
import java.util.Map;

/**
 * @description: 模板中心
 * @Author: hongxiao
 * @date: 2019-03-02 19:23
 * @since v1.0
 */
public interface AppModuleModel extends IModel<AppModuleEntity> {
    /**
     * 获取实体
     * @param key 主键
     * @return
     * @throws
     *
     * @author hongxiao
     * @date: 2019-03-02 22:05
     * @since v1.0
     * @version v1.0
     */
    AppModuleEntity getByKey(Long key);
    /**
     * 获取实体
     * @param key 主键
     * @return
     * @throws
     *
     * @author hongxiao
     * @date: 2019-03-02 22:05
     * @since v1.0
     * @version v1.0
     */
    AppModuleEntity getByKeyIgnoreDel(Long key);

    /**
     * 获取所有的应用
     * @param
     * @return java.util.List<com.xbongbong.pro.domain.entity.AppModuleEntity>
     * @author 石安
     * @date 2020-01-09
     */
    List<AppModuleEntity> getAllList();
    /**
     * 获取应用模板列表
     * @param param
     * @return
     * @throws
     *
     * @author hongxiao
     * @date: 2019-03-02 20:43
     * @since v1.0
     * @version v1.0
     */
    List<AppModuleEntity> getList(Map<String, Object> param);

    /**
     * 根据别名获取应用
     * @param alias
     * @return
     */
    AppModuleEntity getByAlias(String alias);

    /**
     * 获取镜像应用
     * @param mirrorId
     * @return com.xbongbong.pro.domain.entity.AppModuleEntity
     * @author 石安
     * @date 2020-02-24
     */
    AppModuleEntity getByMirrorId(Long mirrorId);

    List<AppModuleEntity> findEntitys(Map<String, Object> param);

    void updateBatch(List<AppModuleEntity> appModuleEntityList);

    void updateName(Long id, String name, String instruction);

    /**
     * 保存应用
     * @param appModuleEntity
     * @return
     */
    int save(AppModuleEntity appModuleEntity) throws XbbException;
}
